

<div class="main" role="main">

    <!-- Page Heading -->
    <section class="page-heading">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <h1>Profilo Pet Sitter <?= $user['Nome'] ?> <?= $user['Cognome'] ?></h1>
                </div>
                <div class="col-md-6">
                    <ul class="breadcrumb">
                        <li><a href="<?=base_url()?>">Home</a></li>
                        <li><a href="#">Pet Sitters</a></li>
                        <li class="active">Profilo</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>
    <!-- Page Heading / End -->

    <!-- Page Content -->
    <section class="page-content">
        <div class="container">

            <div class="row">
                <div class="content col-md-8">

                    <div itemscope itemtype ="http://schema.org/Person"  class="job-profile-info">
                        <div class="row">
                            <div class="col-md-5">
                                <figure class="alignnone">
                                    <img itemprop="image"  src="<?= base_url() ?><?= $user['path_profile'] ?>" alt="Foto di <?= $user['Nome'] ?>, <?= $user['Cognome'] ?> <?= $user['alt_profile'] ?>">
<!--											<img src="http://placehold.it/320x290" alt="">-->
                                </figure>
                            </div>
                            <div class="col-md-7">
                               
                                
                            
                                <h2 itemprop="name" class="name"><?= $user['Nome'] ?>
                                  
                                 <?= $user['Cognome'] ?>
                                </h2> 
                               <ul class="meta">
                                   <strong itemprop="jobTitle">
                                        <li>Dog Walker</li>
                                    <li>Pet Sitter</li>
                                       
                                   </strong>
                                   
                                </ul>
                                <ul class="info">
                                    <li >
                                        <i class="fa fa-map-marker"></i>
                                        <span itemprop="address" id="address"><?= $user['Indirizzo'] ?>, <?= $user['Citta'] ?> </span>

                                    </li>
                                    <li><i class="fa fa-money"></i>Costo Giornaliero : <strong><?= $user['CostoGiornaliero'] ?>€</strong></li>
                                    <li><i class="fa fa-eur"></i>Costo Orario : <strong><?= $user['CostoOrario'] ?>€</strong></li>
                                    <li><i class="fa fa-plus-square"></i>Costo <i class="fa fa-paw"></i>Aggiuntivo : <strong><?= $user['CostoPetAggiuntivo'] ?>€</strong></li>


                                </ul>
                                
                                 <div class="col-md-3">
                                     <?php if($this->session->userdata('logged_in')) {?>
                                    
                                    
                                    <div   class="btn dropdown-toggle" href=""  data-toggle="dropdown" >  
                                        <i  class="fa fa-envelope"></i>
                                            <?php if($unRead>0) {?>
                                                <span id="badgemessaggio" class="badge animated bounceIn"><?= $unRead ?> </span> 
                                                 <?php } ?>
                                                
                                                     </div> 
                                
                                
                                                    <ul class="dropdown-menu messages">
                                                        <li class="dropdown-menu-title"><a href="<?= site_url("welcome/inbox/") ?>/<?= $id?>"> Hai <?= $unRead ?> messaggi non letti</a> </li>
                                                        <?php foreach ($inbox as $key => $value):?>
                                                        <li><a href="<?= site_url("welcome/inbox/") ?>/<?= $id?>/<?= $value['id']?>"><strong><?= $value['Titolo'] ?></strong></a></li>
                                                        <?php endforeach; ?>
                                                    </ul>

                                      <?php } ?>
                                     
                                     
                                 </div>
                                
                              

                                <div class="spacer-lg"></div>

                               <?php if(!$this->session->userdata('logged_in')) {?>
                                 <?php if($check===true){ ?> 
                                            
                                                     <div class="alert alert-success alert-dismissable">
                                                        <button class="close" aria-hidden="true" data-dismiss="alert" type="button">
                                                                <i class="fa fa-times"></i>
                                                        </button>
                                                             <strong>
                                                            Well done!
                                                           </strong>
                                                                messaggio inviato
                                                    </div>
                                         <?php }else if($check===0){ ?>
                                
                                         <div id="showit" class="btn btn-lg"><span  class="fa fa-envelope"></span> Send Message</div>
                                              
                                           
                                             
                                         <?php }else{?>
                                
                                            <div class="alert alert-danger alert-dismissable">
                                                     <button class="close" aria-hidden="true" data-dismiss="alert" type="button">
                                                           <i class="fa fa-times"></i>
                                                        </button>
                                                     <strong> Messaggio non inviato </strong>
                                                           Prova a ricaricare la pagina e riprova
                                                 </div>
                                                
                                         <?php }?>  
                                          <?php }?> 

                            </div>



                        </div>
                        <div id="formessaggio" class="col-md-12" style="display:none;">
                           <button aria-hidden="true" data-dismiss="alert" class="close" type="button"><i class="fa fa-times"></i></button>
                            <h2>Invia Messaggio A <?= $user['Nome'] ?></h2>
                            <form action="<?php echo site_url('profilo/message/3/'.$id) ?>" id="message-form" method="POST">
                                 <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label>Title <span class="required">*</span></label>
                                            <textarea
                                                data-msg-required="Please enter your title."
                                                rows="1"
                                                class="form-control"
                                                name="titolo"
                                                id="message"></textarea>
                                        </div>
                                        <div class="form-group">
                                            <label>Message <span class="required">*</span></label>
                                            <textarea
                                                data-msg-required="Please enter your message."
                                                rows="10"
                                                class="form-control"
                                                name="message"
                                                id="message"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    
                                    
                                    <div class="col-md-12">
                                    
                                        
                                        <input type="submit" value="Send Message" class="btn btn-primary" >
                                    
                                    
                                    </div>
                                </div>
                                
                                
                            </form>
                        </div>
                        <div class="spacer-lg"></div>
                        <span itemprop="description">
                        <h4><?= $user['TitoloAnnuncio'] ?></h4>
                        <p><?= $user['DescrizioneAnnuncio'] ?></p>
                        </span>
                        <hr class="lg">

                        <h4>Location</h4>
                        <!-- Google Map -->
                        <div class="googlemap-wrapper">
                            <div id="map_canvas" class="map-canvas"></div>
                        </div>
                        <!-- Google Map / End -->
 <hr class="lg">
                        <?php if (isset($animali) && $animali != NUll) {?>
                       
                        <h4><i class="fa fa-paw"></i>I Miei Amici a quattro zampe <i class="fa fa-paw"></i></h4>
                        <div class="prev-next-holder text-right">
                            <a class="prev-btn" id="carousel-prev"><i class="fa fa-angle-left"></i></a>
                            <a class="next-btn" id="carousel-next"><i class="fa fa-angle-right"></i></a>
                        </div>
                        
                        <div class="owl-carousel-wrapper row">
                            <div id="owl-carousel" class="owl-carousel">
                                <?php foreach ($animali as $item): ?>
                                <div class="project-item">
                                    <div class="project-item-inner" itemprop="follows" itemscope="" itemtype="http://schema.org/Person">
                                        <figure class="alignnone project-img">
                                            <img itemprop="image" src="<?=base_url()?><?=$item['pet_foto_path']?>" alt="Pet <?=$item['NomePet']?> " />
                                            <div class="overlay">
                                                <a href="<?=site_url('profilo/pet/' . $id ."/" . $item['IDPET'])?>" class="dlink"><i class="fa fa-link"></i></a>
                                                <a href="<?=base_url()?><?=$item['pet_foto_path']?>" class="popup-link zoom"><i class="fa fa-search-plus"></i></a>
                                            </div>
                                        </figure>
                                        <div class="project-desc">
                                            <h4 class="title" itemprop="name"><a href="#"><?=$item['NomePet']?></a></h4>
                                            <span class="desc"><?=$item['Razza']?>/<?=$item['Taglia']?></span>
                                        </div>
                                    </div>
                                    
                                </div>
                                <?php endforeach; ?>
                            </div>
                        </div>

                        <hr class="lg">
                        <?php } ?>
                        <div class="row">
                            <div class="col-sm-4 col-md-4">
                                <h4>Certificazioni</h4>
                                <div class="list list__arrow2">
                                    <ul>
                                        <li><?= $user['Certificazioni'] ?></li> 
                                    </ul>
                                </div>
                            </div>
                            <div class="col-sm-4 col-md-4">
                                <h4>Esperienza</h4>
                                <div class="list list__arrow2">
                                    <ul>
                                        <li><?= $user['Esperienza'] ?></li> 
                                        <li>Mi Considero: <?= $user['Descrizione'] ?></li> 


                                    </ul>
                                </div>
                            </div>
                            <div class="col-sm-4 col-md-4">
                                <h4>Education</h4>
                                <div class="list list__arrow2"  itemprop="awards">
                                    <ul>
                                        <li>
                                            <?= $user['Specializzazioni'] ?><br>
<!--													<span class="date text-muted"><i class="fa fa-calendar"></i> Jan 2009 - Mar 2010</span>
                                                <div class="position">Bachelor degree</div>-->
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>


                </div>

                <!-- Sidebar -->
                <aside class="sidebar col-md-3 col-md-offset-1 col-bordered">
                    <hr class="visible-sm visible-xs lg">
                    <!-- Widget :: Recent Jobs -->
                    <div class="widget_recent_jobs widget widget__sidebar">
                        <h3 class="widget-title">Tipi di Animali Accuditi</h3>
                        <div class="widget-content">
                            <ul class="job_listings">
                                <?php foreach ($animaliProtected as $item): ?>
                                    <li>
                                        <a href="#">
                                            <div class="position">
                                                <h3><?= $item['Nome'] ?></h3>
                                            </div>
                                            <ul class="meta">
                                                <li class="job-type">
                                                    <?= $item['Descrizione'] ?>
                                                </li>
                                            </ul>
                                        </a>
                                    </li>
                                <?php endforeach; ?>


                                <?php if (!empty($casa)) { ?>
                                    <li><h2 class="widget-title" style="margin-bottom:0.5em!important">La mia Casa</h2>
                                        <div class="position">
                                            <h3>MQ: <?= $casa['MetriQuadri'] ?></h3>
                                            <h3>Tipo: <?= $casa['TipoCasa'] ?></h3>
                                            <h3><?= $casa['DescCasa'] ?></h3>
                                        </div>
                                        <ul class="casa">

                                            <li class="">
    <?php if ($casa['Terrazzo'] != '0'): ?>
                                                    Terrazzo : <i class="fa fa-toggle-on fa-lg fa-lg"></i>
                                                    MQ: <?= $casa['MQTerrazzo'] ?>
    <?php else: ?>
                                                    Terrazzo : <i class="fa fa-toggle-off fa-lg fa-lg"></i>
                                                <?php endif; ?>
                                            </li>	
                                            <li >
    <?php if ($casa['Giardino'] != '0'): ?>
                                                    Giardino : <i class="fa fa-toggle-on fa-lg fa-lg"></i>
                                                    MQ: <?= $casa['MQGiardino'] ?>
    <?php else: ?>
                                                    Giardino : <i class="fa fa-toggle-off fa-lg fa-lg"></i>

    <?php endif; ?>
                                            </li>

                                            <li >
    <?php if ($casa['VicinanzaParchi'] != '0'): ?>
                                                    Vicinanza Parchi : <i class="fa fa-toggle-on fa-lg fa-lg"></i>
                                                <?php else: ?>
                                                    Vicinanza Parchi : <i class="fa fa-toggle-off fa-lg fa-lg"></i>
                                                <?php endif; ?>
                                            </li>
                                            <li >
    <?php if ($casa['PresenzaAltriAnimali'] != '0'): ?>
                                                    Presenza Altri Animali : <i class="fa fa-toggle-on fa-lg"></i>
                                                <?php else: ?>
                                                    Presenza Altri Animali : <i class="fa fa-toggle-off fa-lg"></i>
                                                <?php endif; ?>
                                            </li>
                                            <li >
    <?php if ($casa['Supervisione24H'] != '0'): ?>
                                                    Supervisione 24H : <i class="fa fa-toggle-on fa-lg"></i>
                                                <?php else: ?>
                                                    Supervisione 24H : <i class="fa fa-toggle-off fa-lg"></i>
                                                <?php endif; ?>
                                            </li>
                                            <li >
    <?php if ($casa['RitiroGratuito1KM'] != '0'): ?>
                                                    Ritiro Gratuito 1KM : <i class="fa fa-toggle-on fa-lg"></i>
                                                <?php else: ?>
                                                    Ritiro Gratuito 1KM : <i class="fa fa-toggle-off fa-lg"></i>
                                                <?php endif; ?>
                                            </li>
                                            <li >
    <?php if ($casa['RitiroGratuito10KM'] != '0'): ?>
                                                    Ritiro Gratuito 10KM : <i class="fa fa-toggle-on fa-lg"></i>
                                                <?php else: ?>
                                                    Ritiro Gratuito 10KM : <i class="fa fa-toggle-off fa-lg"></i>
                                                <?php endif; ?>
                                            </li>
                                        </ul>

                                    </li>

<?php }else { ?>
                                    <li><h2 class="widget-title" style="margin-bottom:0.5em!important">La mia Casa</h2> 
                                        Non sono disponibili informazioni sulla casa, ciò comporta che l'utente non ospita in casa
                                    </li>

<?php } ?>



                            </ul>      



                            </ul>
                        </div>
                    </div>
                    <!-- /Widget :: Recent Jobs -->
                </aside>
                <!-- Sidebar / End -->

            </div>
        </div>
    </section>
    <!-- Page Content / End -->
    <script type="text/javascript">
        function initialize() {
            var myLatlng = new google.maps.LatLng(<?= $user['lat'] ?>,<?= $user['long'] ?>);
            var mapOptions = {
                zoom: 14,
                center: myLatlng
            }
            var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);

            var marker = new google.maps.Marker({
                position: myLatlng,
                map: map,
                title: '<?= $user['Nome'] ?>'
            });
        }
        google.maps.event.addDomListener(window, 'load', initialize);
        $().ready(function(){
            initialize();
        });
    </script>
